const { ipcMain } = require('electron');
const TrimSvg = require('../utils/TrimSvg');

const trimSvgFn = async (event, config, mainWindow) => {
  try {
    const trimmer = new TrimSvg(config);
    const result = await trimmer.process(mainWindow);
    return result;
  } catch (error) {
    console.error('SVG裁剪失败:', error);
    throw new Error(error.message);
  }
};

module.exports = { trimSvgFn };
